using Abp.Runtime.Validation;
using System;
using System.ComponentModel.DataAnnotations;

namespace Mt.Site.Application.Taxonomys.FrontDto
{
    public class GetTaxonomyTreeByParentIdInput :  ICustomValidate
    {
        public Guid? ParentId { get; set; }

        public Guid? TypeId { get; set; }

        public void AddValidationErrors(CustomValidationContext context)
        {
            if (ParentId == null && TypeId == null)
            {
                context.Results.Add(new ValidationResult("ParentId 和 TypeId 不能同时为空"));
            }
        }
    }
}
